<?php
namespace app\xcxapi\validate;

use think\Validate;

class StudentValidate extends Validate
{
	protected $rule = [
		'phone' => 'regex:1[3-9]\d{9}|require|unique:edu_student,campus_id^phone',
		'id' => 'require|integer',
	];

	protected $message = [
		'phone.require' => '手机号码不能为空',
		'phone.regex' => '手机号错误',
		'phone.unique' => '手机号已存在',
		'id.require' => '客户ID不能为空',
		'id.integer' => '客户ID类型错误',
	];

	protected $scene = [
		'student' => ['id'],
		'editStudent' => ['id','phone'],
	];
}
